Skip to content

Conversation

@kdawgwilk
Copy link
Contributor

  • Extend memory option types/mappings to include 1536MB and 3072MB with display labels.
  • Map new sizes to sensible v2 CPU defaults (1 CPU for 1.5GB, 2 CPU for 3GB) and keep gen1 allowed set unchanged.
  • Add validation guard so gen1 rejects unsupported memory values; update coverage to allow new sizes for v2 and assert the gen1 rejection.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kdawgwilk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the flexibility of function deployments by adding new memory configuration options (1.5GB and 3GB) and updating their corresponding CPU allocations for v2 functions. It also improves robustness by implementing validation to ensure that GCF generation 1 functions are restricted to their supported memory values. Additionally, the changes incorporate support for the latest Node.js 24 runtime.

Highlights

  • Expanded Memory Options: Introduced new memory allocation options (1536MB and 3072MB) for functions, enhancing configuration flexibility.
  • Updated CPU Mappings: Configured default CPU allocations for the new 1536MB and 3072MB memory sizes specifically for v2 functions.
  • GCFv1 Memory Validation: Added a validation guard to prevent GCF generation 1 functions from being configured with memory values not supported by that generation.
  • Node.js 24 Runtime Support: Included support for the Node.js 24 runtime, ensuring compatibility with the latest version.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@kdawgwilk kdawgwilk changed the title Feature/new_function_memory_allocation_options feat(functions): add 1.5GB and 3GB memory options for v2 Nov 21, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively adds support for 1.5GB and 3GB memory options for GCFv2 functions. The changes include updating the necessary type definitions, constants, and mappings, as well as adding validation to prevent these new options from being used with GCFv1. The accompanying tests are well-written and cover the new functionality and validation logic.

I have a couple of suggestions to improve maintainability. One is to address code duplication for memory option definitions across different files. The other is to keep the scope of this PR focused by moving unrelated changes for nodejs24 to a separate PR. Overall, this is a solid contribution.

Comment on lines +208 to +222
export type MemoryOption =
| 128
| 256
| 512
| 1024
| 1536
| 2048
| 3072
| 4096
| 8192
| 16384
| 32768;
const allMemoryOptions: MemoryOption[] = [
128, 256, 512, 1024, 1536, 2048, 3072, 4096, 8192, 16384, 32768,
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a duplication of memory option definitions here and in src/deploy/functions/backend.ts. To improve maintainability and avoid having to update memory options in multiple places, we should define these constants in a single location.

I suggest we make src/deploy/functions/backend.ts the single source of truth for memory options. You can remove MemoryOption and allMemoryOptions from this file. Additionally, the type is named MemoryOption here, but MemoryOptions in backend.ts. Consolidating them would also resolve this inconsistency.

To fix the error message in toBackend (line 516), you'll need to:

  1. Export allMemoryOptions from src/deploy/functions/backend.ts.
  2. Import allMemoryOptions in this file (src/deploy/functions/build.ts).

This will centralize the memory option definitions and make future updates easier.

Comment on lines 21 to 23
it("identifies nodejs24 as a valid runtime", () => {
expect(supported.isRuntime("nodejs24")).to.be.true;
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These test changes for nodejs24 seem unrelated to the main purpose of this pull request, which is to add new memory options. To keep pull requests focused and easier to review, it's generally best to submit unrelated changes in a separate PR.

- Extend memory option types/mappings to include 1536MB and 3072MB with display labels.
- Map new sizes to sensible v2 CPU defaults (1 CPU for 1.5GB, 2 CPU for 3GB) and keep gen1 allowed set unchanged.
- Add validation guard so gen1 rejects unsupported memory values; update coverage to allow new sizes for v2 and assert the gen1 rejection.
@kdawgwilk kdawgwilk force-pushed the feature/new_function_memory_allocation_options branch from c5f62ca to c340d73 Compare November 21, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant